<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0,maximum-scale=1,minimum-scale=1,user-scalable=no"
    />
    <title>12-获取dom元素.html</title>
    <style>
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }
    </style>
  </head>
  <body>
    <div>
      <button>按钮1</button>
    </div>
    <p>
      <button>按钮2</button>
    </p>

    <script>
      // const btn1=document.querySelector("div button");
      const div = document.querySelector("div"); // 在html里面 来寻找按钮
      const btn1 = div.querySelector("button"); // 在div里面 来寻找 按钮！！
      console.log(btn1);
    </script>
  </body>
</html>
